<?php
    //新增菜品表单
    function display_release_dishes_form()
    {
?>
    <form method="post" action="merchant_release_dishes.php" enctype="multipart/form-data" id="file_upload">
        <table width="250" cellpadding="1" cellspacing="0" bgcolor="#FFFF99">
            <tr>
                <td>输入菜品名：</td>
                <td><input type="text" name="name" maxlength="20" /></td>
            </tr>
            <tr>
                <td>输入菜品简介：</td>
                <td><input type="text" name="info" maxlength="200" /></td>
            </tr>
            <tr>
                <td>输入菜品价格：</td>
                <td><input type="text" name="price" maxlength="10" /></td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" value="确认" />
                </td>
            </tr>
        </table>
    </form>
<?php
    }
    //显示商家中心页面
    function display_merchant_center(){
?>
    <a href="merchant_release_dishes_form.php">发布菜品</a><br>
    <a href="merchant_display_my_dishes.php">查看、管理我的菜品</a><br>
    <a href="merchant_display_my_order.php">查看订单</a><br>
    <a href="user_center.php">返回上页</a><br>
<?php
    }
    //显示修改菜品表单
    function display_update_dishes_form($did)
    {
?>
    <form method="post" action="merchant_update_dishes.php" enctype="multipart/form-data" id="file_upload">
        <table width="250" cellpadding="1" cellspacing="0" bgcolor="#FFFF99">
            <input type="hidden" name="did" value="<?php echo $did; ?>" />
            <tr>
                <td>修改简介：</td>
                <td><input type="text" name="info" placeholder=<?php require_once('merchant_fns.php'); echo get_dishes_info($did); ?> /></td>
            </tr>
            <tr>
                <td>修改菜品价格：</td>
                <td><input type="text" name="price" maxlength="10" /></td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" value="确认" />
                </td>
            </tr>
        </table>
    </form>
<?php
    }
    //显示搜索菜品结果
    function display_search_dishes_result($result){
?>
    <table border="1">
        <tr>
            <th>菜品ID</th>
            <th>菜品名称</th>
            <th>菜品简介</th>
            <th>菜品价格</th>
            <th>已售数量</th>
            <th>是否推荐</th>
            <th>菜品状态</th>
            <th>操作</th>
        </tr>
        <?php
        while ($row = $result->fetch_array()) {
        echo "<tr>";
        echo "<td>{$row['did']}</td>";
        echo "<td>{$row['name']}</td>";
        echo "<td>{$row['info']}</td>";
        echo "<td>{$row['price']}</td>";
        echo "<td>{$row['qsold']}</td>";
        echo "<td>{$row['reced']}</td>";
        echo "<td>{$row['state']}</td>";
        echo "<td><a href=\"merchant_management_dishes.php?did={$row['did']}\">管理</a></td>";
        echo "</tr>";
        echo "</table>";
        }
        ?>
<?php
    }
?>